home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / TC Prog Guide.cpt / picture ƒ / screen.h < prev    next >
Text File  |  1991-02-16  |  3KB  |  98 lines

  1. /*
  2. *    FILE:        screen.h
  3. *    AUTHOR:        R. Gonzalez
  4. *    CREATED:    Oct. 3, 1990
  5. *
  6. *    REVISED:    Norman Gaskill
  7. *    REV. DATE:    Dec. 16, 1990
  8. *    CHANGES:    Added PC_Screen code
  9. *
  10. *    Declaration of Screen, Mac_Screen, and PC_Screen classes, to
  11. *    encapsulate machine-specific graphics code.
  12. */
  13.  
  14. # ifndef    screen_h
  15. # define    screen_h
  16.  
  17. # include    "class.h"
  18. # include    "frame.h"
  19. # include    "coord.h"
  20. # include    "color.h"
  21.  
  22. # define    MAX_WINDOWS    100
  23.  
  24. /******************************************************************
  25. *    Screen abstract class to isolate graphics I/O
  26. ******************************************************************/
  27. struct    Screen:Generic_Class
  28. {
  29.     Frame            *device_frame;
  30.     Frame            *normalized_frame;
  31.     int                num_windows;
  32.  
  33.     boolean            init(void);
  34.     virtual int        new_window(Frame*);
  35.     virtual void    make_closest(int);
  36.     virtual void    get_window_device_frame(int,Frame*);
  37.     virtual double    get_device_aspect_ratio(void);
  38.     virtual void    set_normalized_frame(double,double,double,double);
  39.     virtual void    set_current_window(int);
  40.     virtual void    set_pen_color(color);
  41.     virtual void    fill_window(void);
  42.     virtual void    draw_line(Coord2*,Coord2*);    
  43.     virtual void    move_to(Coord2*);
  44.     virtual void    draw_to(Coord2*);
  45.     virtual boolean    mouse_button_is_down(void);
  46.     virtual void    wait(void);
  47.     boolean            destroy(void);
  48. };
  49.  
  50. # ifdef        THINK_C
  51.  
  52. # include    "WindowMgr.h"
  53.  
  54. /******************************************************************
  55. *    Mac_Screen class to allow graphics I/O on Macintosh computers
  56. ******************************************************************/
  57. struct    Mac_Screen:Screen
  58. {
  59.     WindowPtr    window[MAX_WINDOWS];
  60.     WindowPtr    current_window;
  61.     int            old_mbar_height;
  62.  
  63.     boolean        init(void);
  64.     int            new_window(Frame*);
  65.     void        make_closest(int);
  66.     void        get_window_device_frame(int,Frame*);
  67.     void        set_current_window(int);
  68.     void        set_pen_color(color);
  69.     void        fill_window(void);
  70.     void        move_to(Coord2*);
  71.     void        draw_to(Coord2*);
  72.     boolean        mouse_button_is_down(void);
  73.     boolean        destroy(void);
  74. };
  75.  
  76. # else
  77.  
  78. /******************************************************************
  79. *    PC_Screen for graphics output on IBM PC compatibles
  80. ******************************************************************/
  81. struct    PC_Screen:Screen
  82. {
  83.     boolean        init(void);
  84.     int            new_window(Frame*);
  85.     void        make_closest(int);
  86.     void        get_window_device_frame(int,Frame*);
  87.     void        set_current_window(int);
  88.     void        set_pen_color(int); /* can't use "color" in Turbo C++? */
  89.     void        fill_window(void);
  90.     void        move_to(Coord2*);
  91.     void        draw_to(Coord2*);
  92.     void        wait(void);
  93.     boolean        destroy(void);
  94. };
  95.  
  96. # endif
  97. # endif
  98.